/**
 * @author banglong
 * @date 2016/8/18.
 */
define(['xFetch'], function (fetch) {


  // get goods
  // var getGoodsToDataSet = function (param) {
  //     return fetch('/api/sendPostRequest', param);
  // };
  var getGoodsToDataSet = function (param) {
    var url = !param.isGetJsonFile ? '/api/sendPostRequest' : '/catch/GetGoodsToDataSet.json';
    if (!param.isGetJsonFile) {
      return fetch(url, param);
    } else {
      return fetch(url, param, true);
    }
  };

  // get goods count and batch
  var getGoodsBatchStatus = function (param) {
    return fetch('/api/sendPostRequest', param);
  };

  //
  var selectGoodsToDept = function (param) {
    return fetch('/api/sendPostRequest', param);
  };

  //
  var getBillDetailsBySN = function (param) {
    return fetch('/api/sendPostRequest', param);
  };

  var inputDrawBill = function (param) {
	 
   return fetch('/api/sendPostRequest', param);
  };

  var getBatchLayoutWithCards = function (param) {
    return fetch('/api/sendPostRequest', param);
  };

  var getBill = function (param) {
    return fetch('/api/sendPostRequest', param);
  };

  // 发送
  var sendDrawBill = function (param) {
    return fetch('/api/sendPostRequest', param);
  };

  // get
  var getPackageBigCats = function (param) {
    return fetch('/api/sendPostRequest', param);
  };

  // 查询 物品规格信息
  var getBoxSpec = function (param) {
    return fetch('/api/sendPostRequest', param);
  };

  // 查询 物品的地址信息
  var getImages = function (param) {
    return fetch('/api/sendPostRequest', param);
  };

  //查询阳光申请维护物品
  var sunMaint = function (param) {
	return fetch('/api/sunMaint', param);
 };
 
 //新增api
//查询账户余额
 var getAccountBalance = function (param) {
   return fetch('/api/sendPostRequest', param);
 };
//查询账户允许超额额度
 var getAccountLimit = function (param) {
   return fetch('/api/sendPostRequest', param);
 };
//维修单
 var generateRepairBill = function (param) {
   return fetch('/api/sendPostRequest', param);
 };

  return {
    getGoodsToDataSet: getGoodsToDataSet,
    getGoodsBatchStatus: getGoodsBatchStatus,
    selectGoodsToDept: selectGoodsToDept,
    getBillDetailsBySN: getBillDetailsBySN,
    inputDrawBill: inputDrawBill,
    getBatchLayoutWithCards: getBatchLayoutWithCards,
    getBill: getBill,
    sendDrawBill: sendDrawBill,
    getPackageBigCats: getPackageBigCats,
    getBoxSpec: getBoxSpec,
    getImages: getImages,
    sunMaint:sunMaint,
    getAccountBalance:getAccountBalance,
    getAccountLimit:getAccountLimit,
    generateRepairBill:generateRepairBill
  }
});